package com.slz3.business.module.messageManagement.mesOrder.steward;

import com.slz3.business.module.messageManagement.mesOrder.domain.MesOrder;
import com.slz3.business.module.messageManagement.mesOrder.domain.MesOrderCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class MesOrderResponse {

    @Resource
    private MesOrderResController mesOrderResController;

    public  Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(MesOrder.class).flatMap(mesOrder ->
                mesOrderResController.add(req, mesOrder)
        );
    }

    public  Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(MesOrderCondition.class).flatMap(mesOrderCondition ->
                mesOrderResController.delete(req, mesOrderCondition)
        );
    }

    public  Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(MesOrder.class).flatMap(mesOrder ->
                mesOrderResController.modify(req, mesOrder)
        );
    }


    public  Mono<ServerResponse> list(ServerRequest req) {
        return mesOrderResController.list(req);
    }

    public  Mono<ServerResponse> info(ServerRequest req) {
        return mesOrderResController.info(req);
    }

    public  Mono<ServerResponse> choice(ServerRequest req) {
        return mesOrderResController.choice(req);
    }

    public  Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(MesOrderCondition.class).flatMap(mesOrderCondition ->
                mesOrderResController.auditSubmit(req, mesOrderCondition)
        );
    }

    public  Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(MesOrderCondition.class).flatMap(mesOrderCondition ->
                mesOrderResController.audit(req, mesOrderCondition)
        );
    }

    public  Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(MesOrderCondition.class).flatMap(mesOrderCondition ->
                mesOrderResController.auditReject(req, mesOrderCondition)
        );
    }

    public  Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(MesOrderCondition.class).flatMap(mesOrderCondition ->
                mesOrderResController.usingEnable(req, mesOrderCondition)
        );
    }

    public  Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(MesOrderCondition.class).flatMap(mesOrderCondition ->
                mesOrderResController.usingDisable(req, mesOrderCondition)
        );
    }   

}
